import java.awt.Dimension;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.GridLayout;

public class Main extends JFrame {

	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	BlackBook blackBook = new BlackBook();
	JPanel display = new JPanel();

	public Main() {
		configureLayout();
	}

	private void configureLayout() {
		display.setPreferredSize(new Dimension(300, 300));
		display.setVisible(true);
		this.setContentPane(display);
		this.pack();
		this.setVisible(true);

		// Add required components.
		String[] columns = { "First Name", "Last Name", "Age", "Phone Number",
				"Cool Rating" };
		Object[][] data = {{"Apple","A","a","a","a"}};
		Person[] person = blackBook.getblackBook();
		for (int i = 0; i < 0; i++) {
			int x = 0;
			data[i][x] = person[i].getFirstName();
			data[i][x + 1] = person[i].getLastName();
			data[i][x + 2] = person[i].getAge();
			data[i][x + 3] = person[i].getPhoneNumber();
			data[i][x + 4] = person[i].getCoolRating();
		}
		JTable table = new JTable(data, columns);
		JScrollPane scrollPane = new JScrollPane(table);
		table.setFillsViewportHeight(true);
		display.add(table);

	}

	public static void main(String[] args) {
		new Main();
	}
}
